package com.example.liyuehui.myapplication;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import static android.support.v7.widget.LinearLayoutManager.HORIZONTAL;

public class MainActivity extends AppCompatActivity {
	RecyclerView recyclerview;
	TestRecyclerviewAdapter adapter;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		recyclerview = findViewById(R.id.recyclerview);
		recyclerview.setLayoutManager(new LinearLayoutManager(this, HORIZONTAL, false));
		adapter = new TestRecyclerviewAdapter(this);
		recyclerview.setAdapter(adapter);
	}
}
